package one.stand.feign;

import one.stand.fallback.CrmFallBack;
import one.stand.model.ResultModel;
import one.stand.request.*;
import one.stand.request.live.AttentionUserFrom;
import one.stand.request.live.LiveRequest;
import one.stand.request.live.ShortVideoDataForm;
import one.stand.request.live.ShortVideoQuery;
import one.stand.response.AssembleResponse;
import one.stand.response.CompanyResponse;
import one.stand.response.NoticeResponse;
import one.stand.response.live.LiveResponse;
import one.stand.response.live.ShortVideoResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author Administrator
 */
@Component
@FeignClient(value = "crm-service", fallback = CrmFallBack.class, decode404 = true)
public interface CrmFegin {

    @PostMapping("company/getCompanyId")
    ResultModel<CompanyResponse> getCompanyId(@RequestBody CompanyRequest request);

    /**
     * 得到名片二维码
     */
    @PostMapping("/businessCard/getWxTwoCode")
    ResultModel getWxTwoCode(@RequestBody BusinessCardRequest request);

    /**
     * 验证名片是否过期
     */
    @PostMapping("/businessCard/verifyExpired")
    ResultModel<Long> verifyExpired(@RequestBody BusinessCardRequest request);

    /**
     * 得到名片海报
     *
     * @param request
     * @return
     */
    @PostMapping("businessCard/getCardPoster")
    ResultModel getCardPoster(@RequestBody BusinessCardRequest request);

    @PostMapping("notice/selectEffectiveList")
    ResultModel<List<NoticeResponse>> selectEffectiveList(@RequestBody NoticeRequest request);

    /**
     * 获取拼团详情
     *
     * @param request
     * @return
     */
    @PostMapping("assemble/getGoodsAssembleInfo")
    ResultModel<AssembleResponse> getGoodsAssembleInfo(@RequestBody AssembleRequest request);

    // ------------------ 分享记录

    /**
     * 添加分享记录
     */
    @PostMapping("/shareRecord/addShareRecord")
    ResultModel<Integer> addShareRecord(@RequestBody CreateShareRecordRequest request);

    /**
     * 打开分享 记录
     */
    @PostMapping("/shareRecord/addOpenShareCount")
    ResultModel<Boolean> addOpenShareCount(@RequestBody AddShareCountRequest request);

    @PostMapping("company/getDynamicPoster")
    ResultModel getDynamicPoster(@RequestBody ShareRecordRequest request);


    @PostMapping("shortVideo/addAttentionUser")
    ResultModel<Boolean> addAttentionUser(AttentionUserFrom request);

    @PostMapping("shortVideo/queryPage")
    ResultModel queryShortVideoByList(ShortVideoQuery request);

    @PostMapping("shortVideo/updateData")
    ResultModel<Boolean> updateData(ShortVideoDataForm request);

    @PostMapping("shortVideo/queryById")
    ResultModel<ShortVideoResponse> queryById(ShortVideoQuery request);
}
